package com.cykj.page04.servlet;

import com.cykj.page04.net.MyHttpRequest;
import com.cykj.page04.net.MyHttpResponse;

/**
 * @BelongsProject: HandTomcat
 * @BelongsPackage: com.cykj.page03.servlet
 * @Author: WWJ
 * @CreateTime: 2025-06-19 10:06
 * @Description: TODO
 * @Version: 1.0
 */
public abstract class BaseServlet {
    public abstract void doGet(MyHttpRequest httpRequest, MyHttpResponse httpResponse);
    public abstract void doPost(MyHttpRequest httpRequest, MyHttpResponse httpResponse);

    public void  handlerServlet(MyHttpRequest httpRequest, MyHttpResponse httpResponse){
        if (httpRequest.getRequestMethod().equals("GET")){
            doGet(httpRequest, httpResponse);
        }else if (httpRequest.getRequestMethod().equals("POST")){
            doPost(httpRequest, httpResponse);
        }
    }
}
